<!DOCTYPE html>
<html>
<head>
    <title>新品有戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        tr td{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
{include file="base/header"}
<div style="height:1px;"></div>

<div style="float: right; margin-top: 5px;margin-bottom: 5px" class="box-title " >
    <form class="form-inline" action="{:url('online/mail/index')}" method="get">
        <input type="text" name="title" value="<?php if(isset($title)) echo $title ?>" placeholder="联系人，联系电话" class="form-control" id="exampleInputEmail3" >
        <input type="submit" class="btn btn-default" value="搜索"/>
        <input type="button" onclick="res()" value="全部显示" class="btn btn-default"/>
    </form>
</div>
<table class="layui-table" id="test_table">
    <thead>
    <tr>
        <!--<td>请选择</td>-->
        <td>编号</td>
        <td>商家联系人</td>
        <td>联系电话</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
    <tr>
        <!--<td><input type="checkbox" name="check"/></td>-->
        <td>{$val.id}</td>
        <td>{$val.linkman}</td>
        <td>{$val.telephone}</td>
        <td>
            <button  onclick="order({$val.id})" type="button" class="btn btn-primary btn-xs">查看订单</button>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>
{$result->render()}
</body>
<script>
    //全部显示
    function res() {
        window.location.href = "{:url('online/mail/index')}";
    }
    //查看订单
    function order(id) {
        window.location.href = "{:url('online/mail/order')}?bid="+id;
    }
</script>
</html>